<form class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""
      style="margin-left: 10%;margin-top: 10%">
    <input type="hidden" value="{$row.id}" name="id" readonly="readonly">
    <input type="hidden" value="{$_GET['do']}" name="do" readonly="readonly">
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">{:__('Username')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-username" class="form-control" type="text" value="{$row.username|htmlentities}"
                   readonly="readonly" style="border: none">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">身份证号</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-idcard" class="form-control" type="text" value="{$row.idcard|htmlentities}" readonly="readonly"
                   style="border: none">
        </div>
    </div>

    <!--    充值-->
    {if $_GET['do']=='incMoney'}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">充值金额</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-money" class="form-control" required="required" name="row[money]" type="number" value="">
        </div>
    </div>
    （相当于发放一张优惠券）
    {/if}
    <!--    办卡-->
    {if $_GET['do']=='buyCard'}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">推荐人</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-fromid" class="form-control" type="text" value="{$row.fromid|htmlentities}" readonly="readonly"
                   style="border: none">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">医疗卡号</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-cardno" class="form-control" name="row[cardno]" required="required" type="text"
                   value="{$row.cardno|htmlentities}">
        </div>
    </div>
    （有推荐人，办理成功后，自动奖励3元）
    {/if}
    <!--    挂号-->
    {if $_GET['do']=='guahao'}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">医疗卡号</label>
        <div class="col-xs-12 col-sm-4">
            <input  class="form-control"  required="required" type="text" readonly="readonly"
                   value="{$row.cardno|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">挂号金额</label>
        <div class="col-xs-12 col-sm-4">
            <input  class="form-control total"  required="required" type="text" readonly="readonly"
                    value="3元">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">选择优惠券</label>
        <div >
            <table >
                <tr>
                    <th width="20"></th>
                    <th width="100">来源</th>
                    <th width="100">优惠金额</th>
                    <th width="100">有效截止时间</th>
                </tr>
                    {$row['ticket_radio']}
            </table>

        </div>
    </div>
    {/if}
    <!--   体检-->
    {if $_GET['do']=='tijian'}
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">医疗卡号</label>
        <div class="col-xs-12 col-sm-4">
            <input  class="form-control"  required="required" type="text" readonly="readonly"
                    value="{$row.cardno|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">优惠券金额￥</label>
        <div class="col-xs-12 col-sm-4">
            <input  class="form-control total"  required="required" type="text" readonly="readonly"  name="row[total]"
                    value="0">
        </div>
    </div>
    <div class="form-group">
        <label for="c-username" class="control-label col-xs-12 col-sm-2">选择优惠券</label>
        <div >
            <table >
                <tr>
                    <th width="20"></th>
                    <th width="100">来源</th>
                    <th width="100">优惠金额</th>
                    <th width="100">有效截止时间</th>
                </tr>
                {$row['ticket_checkbox']}
            </table>

        </div>
    </div>
    {/if}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed ">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    var total=0;
    function checkOption(e) {
        if($(e).is(':checked')==true){
            total+=parseInt($(e).attr('data-money'));
        }else{
            total-=parseInt($(e).attr('data-money'));
        }
        $(".total").val(total);
    }
</script>
